import { defineConfig } from "umi";
import routes from "./routes";

export default defineConfig({
  routes,
  plugins: [
    "@umijs/plugins/dist/react-query",
    "@umijs/plugins/dist/access",
    "@umijs/plugins/dist/initial-state",
    "@umijs/plugins/dist/model",
    "@umijs/plugins/dist/layout",
    "@umijs/plugins/dist/tailwindcss",
  ],
  reactQuery: {},
  access: {},
  initialState: {},
  model: {},
  outputPath:'dist', // 配置输出文件名。
  publicPath:'/',
  // history:{
  //   type: 'hash'
  // },
  hash:true,
  esbuildMinifyIIFE: true, // 解决 esbuild 辅助函数冲突问题
  npmClient: "pnpm",
  tailwindcss: {},
  codeSplitting:{
    jsStrategy: 'granularChunks' 
  },
  // 依赖分析
  analyze: {
    analyzerMode: 'server',
    analyzerPort: 8888,
    openAnalyzer: true,
    generateStatsFile: false,
    statsFilename: 'stats.json',
    logLevel: 'info',
    defaultSizes: 'parsed',
 }
});
